package com.example.base.tools

import android.content.Context
import android.location.LocationManager

/**  系统工具类  **/
object SystemTool {

    /**  获取当前是否开启 GPS 定位  **/
    fun isLocServiceEnable(context: Context): Boolean {
        val locationManager =
            context.getSystemService(Context.LOCATION_SERVICE) as LocationManager
        val isProviderGPS = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)
        val isProviderNetwork = locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)
        return isProviderGPS || isProviderNetwork
    }

}